﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using AimGameLibrary;
using AimGameLibrary.GameObject;

using AimGameEngine.EditorObject;

namespace AimGameEngine
{
    public class DictionaryType
    {
        public const String MainObejct = "MainObject";
        Dictionary<String, Dictionary<String, NodeObject>> Maindictionary;
        public Dictionary<String, Dictionary<String, NodeObject>> GetMaindictionarY { get { return Maindictionary; } }
        Boolean Start;
        public DictionaryType()
        {
            Maindictionary = new Dictionary<string, Dictionary<string, NodeObject>>();
            Maindictionary.Add(MainObejct, new Dictionary<string, NodeObject>());
            Start = false;
            NodeTypeValue getnodetype = NodeTypeValue.Boolean;
            foreach (string str in Enum.GetNames(getnodetype.GetType()))
            {
                if (str == "Boolean")
                    Start = true;
                if(Start)
                Maindictionary.Add(str, new Dictionary<string, NodeObject>());
            }
        }
        public void ClearAll()
        {
            foreach (String keys in Maindictionary.Keys)
                Maindictionary[keys].Clear();
        }
        public Dictionary<String, BaseGameObject> ConvertToGameBaseObject(String Type)
        { 
            Dictionary<String, BaseGameObject> tempDic = new Dictionary<string, BaseGameObject>();
            if(GetMaindictionarY.ContainsKey(Type))
                foreach (String subkey in GetMaindictionarY[Type].Keys)
                    tempDic.Add(subkey,GetMaindictionarY[Type][subkey]);
            return tempDic;
        }
    }
}
